package com.shop.repositories;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.shop.entities.User;
import com.shop.mappers.UserMapper;

/**
 * 
 *
 */
@Repository
public class UserRepository {

	@Autowired
	private UserMapper userMapper;
	
	public User findUserById(Integer userId) {
		return userMapper.findUserById(userId);
	}

	public List<User> findAllUsers() {
		return userMapper.findAllUsers(); 
	}
	
	
	public void addUser(User u) {
		userMapper.add(u); 
	}
	
	public void deleteUser(User u) {
		userMapper.delete(u); 
	}
	
	public void updateUser(User u) {
		userMapper.update(u); 
	}
	
	
}
